<extend name="Common/list-base" />

<block name="action">
    <a href="{:U('add')}?root={$root}&dir={$_GET['dir']}" class="btn btn-green">在当前目录下添加文件</a>
</block>
<block name="list">
    <tr>
        <th>文件列表</th>
        <th width="300">操作</th>
    </tr>
    <tr>
        <td>当前目录地址: {$path_now}</td><td></td>
    </tr>

<notempty name="Think.get.dir">
    <tr>
        <td><a href="{:U()}?root={$root}&dir={$back}"><img src="__PUBLIC__/Img/ext/dir.gif" /> 返回上一层</a></td>
        <td></td>
    </tr>
</notempty>

    <foreach name="list" item="v">
    <tr>
        <if condition="$v['is_edit']">
            <td>
                <a href="{:U('edit')}?root={$root}&dir={$v['dir']}"><img src="{$v.ext_img}" /> {$v.name}</a>
            </td>
            <td>
                <a class="btn btn-blue" href="{:U('edit')}?root={$root}&dir={$v['dir']}">修改</a>
                <a class="AjaxConfirm btn btn-red" data-url="{:U('del')}?root={$root}&dir={$v['dir']}" href="javascript:;">删除</a>
            </td>
        <elseif condition="$v['ext'] == 'dir'" />
            <td><a href="{:U()}?root={$root}&dir={$v['dir']}"><img src="{$v.ext_img}" /> {$v.name}</a></td>
            <td></td>
        <else />
            <td><img src="{$v.ext_img}" /> {$v.name}</td>
            <td><a class="AjaxConfirm btn btn-red" data-url="{:U('del')}?root={$root}&dir={$v['dir']}" href="javascript:;">删除</a></td>   
        </if>
    </tr>
    </foreach>
</block>